package com.coocaa.ops.admin.v1.panel.async;

import com.coocaa.ops.admin.v1.mergeposter.provider.IRefreshPosterMergeProvider;
import com.coocaa.ops.common.tool.exception.ExceptionUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author bijiahao
 * @description
 * @date 2020/10/14 10:54
 */
@Slf4j
@Service
public class AiPosterMergeServiceImpl {
    @Autowired
    private IRefreshPosterMergeProvider refreshPosterMergeProvider;

    @Async("mergePosterExecutor")
    public void handleAiPosterMerge(Integer panelId, Integer version) {
        try {
            refreshPosterMergeProvider.refreshPanelPosterMerge(panelId, version, false);
        } catch (Exception e) {
            log.error(ExceptionUtil.getErrorPrintLog("智能角标合成", e));
        }
    }
}
